package model;

import java.sql.Date;

/**
 * Pallet which is a model of the Pallet table.
 */

public class Pallet {
	
	public String id;
	public String orderId;
	public String cookieName;
	public boolean isBlocked;
	public Date produced;
	public Date delivered;
	
	/**
	 * Pallet is the constructor which constructs the model.
	 * @param id is the ID of the Pallet.
	 * @param orderId is the order which the Pallet belong to. Hasn't been given to any order if null.
	 * @param cookieName is the name of the cookie.
	 * @param isBlocked is if the Pallet is blocked.
	 * @param produced is the Date of when the Pallet was produced.
	 * @param delivered is the Date of when the Pallet was delivered. Hasn't been delivered if null.
	 */
	public Pallet(String id, String orderId, String cookieName, boolean isBlocked, Date produced, Date delivered){
		this.id = id;
		this.orderId = orderId;
		this.cookieName = cookieName;
		this.isBlocked = isBlocked;
		this.produced = produced;
		this.delivered = delivered;
	}
	
	/**
	 * Creates the name which is shown in the JList in the Search panel.
	 */
	public String toString(){
		return id+" \t "+cookieName+" \t "+produced.toString();
	}
	
}
